package com.liunian.subject.infra.basic.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.liunian.subject.common.enums.IsDeletedFlagEnum;
import com.liunian.subject.infra.basic.entity.SubjectMultiple;
import com.liunian.subject.infra.basic.entity.SubjectRadio;
import com.liunian.subject.infra.basic.mapper.SubjectRadioMapper;
import com.liunian.subject.infra.basic.service.SubjectRadioService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class SubjectRadioServiceImpl extends ServiceImpl<SubjectRadioMapper, SubjectRadio> implements SubjectRadioService {

    @Resource
    private SubjectRadioMapper subjectRadioMapper;

    @Override
    public List<SubjectRadio> selectRadioAnswer(long subjectId) {
        LambdaQueryWrapper<SubjectRadio> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(SubjectRadio::getSubjectId, subjectId)
                .eq(SubjectRadio::getIsDeleted, IsDeletedFlagEnum.UN_DELETED.getCode());
        return subjectRadioMapper.selectList(wrapper);
    }
}
